<?php echo $header; ?>
<div id="columnswrapper">
	<?php echo $column_left; ?>
	<div id="content">
		<div class="inner">
			<h2 id="title"><?php echo $heading_title; ?></h2>
			<?php if (!$categories && !$products) { ?>
		    <div><?php echo $text_error; ?></div>
		    <?php } ?>
		    <?php if ($categories) { ?>
		    <table class="list">
		      <?php for ($i = 0; $i < sizeof($categories); $i = $i + 4) { ?>
		      <tr>
		        <?php for ($j = $i; $j < ($i + 4); $j++) { ?>
		        <td width="25%"><?php if (isset($categories[$j])) { ?>
		          <a href="<?php echo $categories[$j]['href']; ?>"><img src="<?php echo $categories[$j]['thumb']; ?>" title="<?php echo $categories[$j]['name']; ?>" alt="<?php echo $categories[$j]['name']; ?>" style="margin-bottom: 3px;" /></a><br />
		          <a href="<?php echo $categories[$j]['href']; ?>"><?php echo $categories[$j]['name']; ?></a>
		          <?php } ?></td>
		        <?php } ?>
		      </tr>
		      <?php } ?>
		    </table>
		    <?php } ?>
		    <div style="clear:both;width:100%;"></div>
		    <?php if ($products) { ?>
		    <div class="sort">
		      <div class="div1">
		      <div class="div2"><?php echo $text_sort; ?>
		        <select name="sort" onchange="location = this.value">
		          <?php foreach ($sorts as $sorts) { ?>
		          <?php if (($sort . '-' . $order) == $sorts['value']) { ?>
		          <option value="<?php echo $sorts['href']; ?>" selected="selected"><?php echo $sorts['text']; ?></option>
		          <?php } else { ?>
		          <option value="<?php echo $sorts['href']; ?>"><?php echo $sorts['text']; ?></option>
		          <?php } ?>
		          <?php } ?>
		        </select>
		        </div>
		      </div>
		      
		    </div>
		    <table>
		    <?php for ($i = 0; $i < sizeof($products); $i=$i+2) { ?>
		    <tr style="clear:both;float:left;width:590px;margin-top:20px;">
		    <?php for ($j = $i; $j < $i+2; $j++) { ?>
		    <td><?php if (isset($products[$j])) { ?>
			<div class="searchresult">							
			<a href="<?php echo $products[$j]['href']; ?>"><img width="200" height="150" alt="<?php echo $products[$j]['name']; ?>" title="<?php echo $products[$j]['name']; ?>" src="<?php echo $products[$j]['thumb']; ?>" /></a>
			<div class="shadow-small"></div>			
			<h3 style="width:200px;"><?php echo $products[$j]['name'];?> </h3>
						
			</div><!-- end post -->
			</td>
			<?php }?>
			<?php }?>
			
			</tr>
			<?php }?>
			</table>
			<div style="clear:both;width:100%;"></div>
			<div class="pagination"><?php echo $pagination; ?></div>
			<?php }?>
			
		</div><!-- end inner -->
	</div><!-- end content -->
	
<?php echo $column_right; ?>
	</div><!-- end columnswrapper -->
<?php echo $footer; ?> 